﻿using DemoUser.Application.User.Dtos;
using DemoUser.Core.User;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DemoUser.Application.User.Interface
{
    public interface IUserService
    {
        
        ///查询用户信息
        /// <summary>
        /// 根据id查询用户信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        OUser SelectById(int id);
        /// <summary>
        /// 根据用户查询用户信息
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        OUser SelectByUser(OUser user);
        /// <summary>
        /// 根据用户名查询用户信息
        /// </summary>
        /// <param name="username"></param>
        /// <returns></returns>
        OUser SelectByUsername(string username);
        /// <summary>
        /// 根据用户名和密码查询用户信息
        /// </summary>
        /// <param name="username"></param>
        /// <param name="password"></param>
        /// <returns></returns>
        OUser SelectByUsernameAndPassword(string username,string password);
        /// <summary>
        /// 新增用户
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        bool insertUser(OUser user);
        /// <summary>
        /// 修改用户
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        OUser UpdateUser(OUser user);
        /// <summary>
        /// 删除用户
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        bool DelUser(int id);


        /// <summary>
        /// 生成Token
        /// </summary>
        /// <param name="username"></param>
        /// <param name="password"></param>
        /// <returns></returns>
        string GenerateToken(string username, string password);
    }
}
